def iszss(n):
    s=n**2
    s1=str(n)
    s2=str(s)
    s22=s2[::-1]
    s11=s1[::-1]
    if s11==s22[0:len(s11)]:
        return True
    else:
        return False

n= 2
s=1
for i in range(n):
    if iszss(i):
        s+=1
print(s)